%% Replication for "How Authoritarian Governments Decide Who Emigrates: Evidence from East Germany"
%% This code replicates all figures and analyses in the paper and online appendix
%% Results were generated in Stata (Version 12) on Windows 11
%% The replication uses five data files: 
%%   (1) Data on country emigration restrictions by year to replicate Figure 2 (exit_visa_data.dta)
%%   (2) Data on emigration, emigration freedom, & sample approvals in East Germany by year to replicate Figures 3 and 5 (EG_year_data.dta)
%%   (3) An applicant-level dataset of East German emigration applications (observations for 1st and last applications) (EG_Replication_Applicant.dta)
%%   (4) An applicant-year panel dataset (observation for each year an application is open) (EG_Replication_PanelYear.dta)
%%   (5) An application-level panel dataset (observation for each application) (EG_Replication_PanelApp.dta)



%%% Initial Figures and Descriptive Statistics

%% Figure 1 (Maps of emigration freedom in four periods)

Produced from V-Dem's Interactive Maps (www.v-dem.net/data_analysis/MapGraph) using "Freedom of Foreign Movement" (accessed March 2022)
Note: 0 = Restricted, 2 = Partly Restricted, 4 = Open


%% Figure 2 (Time series of emigration restrictions) (using exit_visa_data.dta)

twoway (line percentexit year, sort) (line per_any_restrict year)(line per_exit_visa_en year)(line per_no_travel_list_en year)(line per_other_restrictions_en year) , xtitle("Year") ytitle("Proportion of Autocracies") yscale(r(0 1)) ylabel(0(.1)1) text(0.4 1980 "DEMIG exit visa", size(vsmall))  text(0.75 2010 "Any restriction (DoS)", size(vsmall)) text(0.5 2010 "Other restriction (DoS)", size(vsmall)) text(0.25 2010 "Exit visa (DoS)", size(vsmall)) text(0.3 2017 "No travel list (DoS)", size(vsmall)) legend(off)


%% Figure 3 (Emigration and emigration freedom in East Germany by year) (using EG_year_data.dta)

tw line vdem_emig2 year, yaxis(2) || line emig1000 year, yaxis(1) yscale(alt) yscale(alt axis(2))


%% Table 1 (Summary statistics) 
% 1st applications (using EG_Replication_Applicant.dta)
sutex xx_decisioncens_dum xx_survprison xx_opposition xx_opposition_threat xx_opposition_num xx_year xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal xx_reason_econ xx_reason_familygen xx_reason_ideo xx_reason_freedom if xx_app==1, minmax labels file("sum.tex") replace
% All applications (using EG_Replication_PanelApp.dta)
sutex xx_decisioncens_dum xx_appnumber, minmax labels file("sum-app.tex") replace


%% Figure 4 (Lifespan of emigration applications) (using EG_Replication_Applicant.dta)

gen xx_end2 = xx_end
replace xx_end2 = xx_end + 0.1 if xx_start==xx_end
sort xx_start xx_end
gen xxorderid = _n

tw rspike xx_start xx_end2 xxorderid if xx_start!=. & xx_end2!=. & xx_decisioncens_dum_ever==1, hor || rspike xx_start xx_end2 xxorderid if xx_start!=. & xx_end2!=. & xx_decisioncens_dum_ever==0, hor


%% Figure 5 (Applications and approvals in sample by year) (using EG_year_data.dta)

tw bar appnum year if year < 1990 & year >= 1979, yaxis(2) || line firstapp year if year < 1990 & year >= 1979, yaxis(1) yscale(alt) yscale(alt axis(2)) || line dec year if year < 1990 & year >= 1979, yaxis(1)


%% Figure 6 (Punishment in sample by application year) (using EG_Replication_Applicant.dta)

gen xx_yearalt = xx_year
replace xx_yearalt = 1979 if xx_year <= 1979

tw line xx_surv_yearalt xx_yearalt if xx_app==1 & xx_yearalt < 1990 || line xx_prison_yearalt xx_yearalt if xx_app==1 & xx_yearalt < 1990


%% Figure 7 (Opposition in sample by year) (using EG_Replication_PanelYear.dta)

sort xx_appyearalt
tw line xx_opp_yearalt xx_appyearalt if xx_appyear < 1990 || line xx_opp2_yearalt xx_appyearalt if xx_appyear < 1990








%%% Main Empirical Analysis

%% Table 2 (Main results on opposition and approval) (using EG_Replication_Applicant.dta)

eststo clear
global base "xx_year xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal"
global main ""
global cond1 "if xx_app==1"
global cond2 ""
global se "r"
global opp "xx_opposition"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global opp "xx_opposition_threat"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global opp "xx_opposition_num"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global main "xx_reason_econ xx_reason_familygen xx_reason_ideo xx_reason_freedom"
global opp "xx_opposition"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global opp "xx_opposition_threat"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global opp "xx_opposition_num"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
esttab, pr2 label booktabs b(3)


%% Figure 8 (Marginal effect sizes) (run after applicable models in Tables 2 and 4)

global base "xx_year xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal"
global main ""
global cond1 "if xx_app==1"
global cond2 ""
global se "r"
global opp "xx_opposition"
quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
margins, dydx(xx_opposition) post
est store model1
global opp "xx_opposition_threat"
quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
margins, dydx(xx_opposition_threat) post
est store model2
global opp "xx_opposition_num"
quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
margins, dydx(xx_opposition_num) post
est store model3
global base "xx_year xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal"
global main ""
global cond1 "if xx_app==1"
global cond2 ""
global se "r"
global opp "xx_opposition"
quietly logit xx_survprison $base $main $opp $cond1 $cond2, $se
margins, dydx(xx_opposition) post
est store model1b
global opp "xx_opposition_threat"
quietly logit xx_survprison $base $main $opp $cond1 $cond2, $se
margins, dydx(xx_opposition_threat) post
est store model2b
global opp "xx_opposition_num"
quietly logit xx_survprison $base $main $opp $cond1 $cond2, $se
margins, dydx(xx_opposition_num) post
est store model3b
coefplot model1 model1b model2 model2b model3 model3b, yline(0, lpattern(dash)) vertical levels (95)


%% Table 3 (Opposition and approval results in panels)

% Year panel (EG_Replication_PanelYear.dta)
eststo clear
global base "xx_appduration xx_appyear xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal"
global main ""
global cond1 ""
global cond2 ""
global se "r"
global opp "xx_opposition_interp"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
global opp "xx_opposition_interp xx_appyear1985_oppinterp"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
global opp "xx_opposition_interp xx_appyear1985_oppinterp xx_appduration_oppinterp"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
esttab, pr2 label b(3) 

% Application panel (EG_Replication_PanelApp.dta)
eststo clear
global base "xx_appnumber xx_estyear xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal"
global main ""
global cond1 ""
global cond2 ""
global se "r"
global opp "xx_opposition_interp"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global cond1 "if xx_appnumber > 1"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global cond1 "if xx_appnumber > 2"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
esttab, pr2 label b(3)


%% Figure 9 (Marginal effect sizes of opposition by application number) (using EG_Replication_PanelApp.dta)

global base "xx_appnumber xx_estyear xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal"
global main ""
global se "r"
global opp "xx_opposition_interp"
global cond1 ""
quietly logit xx_decisioncens_dum $base $main $opp $cond1, $se
margins, dydx(xx_opposition_interp) post
est store model1
global cond1 "if xx_appnumber > 1"
quietly logit xx_decisioncens_dum $base $main $opp $cond1, $se
margins, dydx(xx_opposition_interp) post
est store model2
global cond1 "if xx_appnumber > 2"
quietly logit xx_decisioncens_dum $base $main $opp $cond1, $se
margins, dydx(xx_opposition_interp) post
est store model3
global cond1 "if xx_appnumber > 3"
quietly logit xx_decisioncens_dum $base $main $opp $cond1, $se
margins, dydx(xx_opposition_interp) post
est store model4
coefplot model1 model2 model3 model4, yline(0, lpattern(dash)) vertical levels (95)


%% Table 4 (Punishment) (using EG_Replication_Applicant.dta)

eststo clear
global base "xx_year xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal"
global main ""
global cond1 "if xx_app==1"
global cond2 ""
global se "r"
global opp "xx_opposition"
eststo: quietly logit xx_survprison $base $main $opp $cond1 $cond2, $se
global opp "xx_opposition_threat"
eststo: quietly logit xx_survprison $base $main $opp $cond1 $cond2, $se
global opp "xx_opposition_num"
eststo: quietly logit xx_survprison $base $main $opp $cond1 $cond2, $se
global opp "xx_opposition"
eststo: quietly ologit xx_punishalt $base $main $opp $cond1 $cond2, $se
global opp "xx_opposition_threat"
eststo: quietly ologit xx_punishalt $base $main $opp $cond1 $cond2, $se
global opp "xx_opposition_num"
eststo: quietly ologit xx_punishalt $base $main $opp $cond1 $cond2, $se
esttab, pr2 label b(3) 


%% Table 5 (Robustness checks) 

% 1st applications predicting approval and punishment (using EG_Replication_Applicant.dta)

global base "xx_year xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal"
global main ""
global cond1 "if xx_app==1"
global se "r"
global opp "xx_opposition"
eststo clear
global cond2 " & xx_year != 1989"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
eststo: quietly logit xx_survprison $base $main $opp $cond1 $cond2, $se
global cond2 " & xx_decision_year != 1984"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
eststo: quietly logit xx_survprison $base $main $opp $cond1 $cond2, $se
global cond2 ""
global main "d_year8-d_year17"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
eststo: quietly logit xx_survprison $base $main $opp $cond1 $cond2, $se
esttab, b(3)

global base "xx_year xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal"
global cond1 "if xx_app==1"
global cond2 ""
global se "r"
global opp "xx_opposition"
eststo clear
global main "xx_family"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
eststo: quietly logit xx_survprison $base $main $opp $cond1 $cond2, $se
global main "xx_tiesback xx_wgcontacts"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
eststo: quietly logit xx_survprison $base $main $opp $cond1 $cond2, $se
global main "xx_educ"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
eststo: quietly logit xx_survprison $base $main $opp $cond1 $cond2, $se
global main "xx_industry_basic xx_industry_govt xx_industry_social"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
eststo: quietly logit xx_survprison $base $main $opp $cond1 $cond2, $se
esttab

% Year Panel predicting approval (using EG_Replication_PanelYear.dta)

eststo clear
global base "xx_appduration xx_appyear xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal"
global main ""
global cond2 ""
global se "r"
global opp "xx_opposition_interp"
global cond1 "if xx_appyear < 1989"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
global cond1 "if xx_appyear != 1984"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
global cond1 ""
global main "d_year9-d_year18"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
global main "xx_family"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
global main "xx_tiesback xx_wgcontacts"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
global main "xx_educ"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
global main "xx_industry_basic xx_industry_govt xx_industry_social"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
esttab

% Application Panel predicting approval (using EG_Replication_PanelApp.dta)

eststo clear
global base "xx_appnumber xx_estyear xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal"
global main ""
global cond2 ""
global se "r"
global opp "xx_opposition_interp"
global cond1 "if !(xx_estyear >= 1989)"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global cond1 "if !(xx_estyear >= 1984 & xx_estyear < 1985)"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global cond1 ""
global main "d_year7-d_year16"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global main "xx_family"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global main "xx_tiesback xx_wgcontacts"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global main "xx_educ"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global main "xx_industry_basic xx_industry_govt xx_industry_social"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
esttab










%%% SI Robustness Checks

%% Table A2 (Main results w/ bureaucracy's judgments of application reason) (using EG_Replication_Applicant.dta)

eststo clear
global base "xx_year xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal"
global cond1 "if xx_app==1"
global cond2 ""
global se "r"
global main "xx_reasonb_econ xx_reasonb_familygen xx_reasonb_ideo xx_reasonb_freedom"
global opp "xx_opposition"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global opp "xx_opposition_threat"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global opp "xx_opposition_num"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
esttab, pr2 label b(3)


%% Table A3 (Year panel results w/ alternative measures of opposition) (using EG_Replication_PanelYear.dta)

eststo clear
global base "xx_appduration xx_appyear xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal"
global main ""
global cond1 ""
global cond2 ""
global se "r"
global opp "xx_opposition_threat_interp"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
global opp "xx_opposition_threat_interp xx_appyear1985_oppthreatinterp"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
global opp "xx_opposition_threat_interp xx_appyear1985_oppthreatinterp xx_appduration_oppthreatinterp"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
global opp "xx_opposition_num_interp"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
global opp "xx_opposition_num_interp xx_appyear1985_oppnuminterp"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
global opp "xx_opposition_num_interp xx_appyear1985_oppnuminterp xx_appduration_oppnuminterp"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
esttab, b(3) pr2


%% Table A4 (Application panel results w/ alternative measures of opposition) (using EG_Replication_PanelApp.dta)

eststo clear
global base "xx_appnumber xx_estyear xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal"
global main ""
global cond1 ""
global cond2 ""
global se "r"
global opp "xx_opposition_threat_interp"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global cond1 "if xx_appnumber > 1"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global cond1 "if xx_appnumber > 2"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global cond1 ""
global opp "xx_opposition_num_interp"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global cond1 "if xx_appnumber > 1"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global cond1 "if xx_appnumber > 2"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
esttab, b(3) pr2


%% Table A5 (Robustness checks for main results)

% 1st applications predicting approval and punishment (using EG_Replication_Applicant.dta)

global base "xx_year xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal"
global cond1 "if xx_app==1"
global cond2 ""
global se "r"
global opp "xx_opposition"
eststo clear
global main "xx_married"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
eststo: quietly logit xx_survprison $base $main $opp $cond1 $cond2, $se
global main "xx_numchild"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
eststo: quietly logit xx_survprison $base $main $opp $cond1 $cond2, $se
global main "xx_debt"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
eststo: quietly logit xx_survprison $base $main $opp $cond1 $cond2, $se
global main "xx_illegalem"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
eststo: quietly logit xx_survprison $base $main $opp $cond1 $cond2, $se
esttab, pr2 b(3)

% Year Panel predicting approval (using EG_Replication_PanelYear.dta)

global base "xx_appduration xx_appyear xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal"
global main ""
global cond1 ""
global cond2 ""
global se "r"
global opp "xx_opposition_interp"
eststo clear
global main "xx_married"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
global main "xx_numchild"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
global main "xx_debt"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
global main "xx_illegalem"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
esttab, pr2 b(3)

% Application Panel predicting approval (using EG_Replication_PanelApp.dta)

global base "xx_appnumber xx_estyear xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal"
global cond1 ""
global cond2 ""
global se "r"
global opp "xx_opposition_interp"
eststo clear
global main "xx_married"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global main "xx_numchild"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global main "xx_debt"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global main "xx_illegalem"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
esttab, pr2 b(3)


%% Tables A6-A9 (covered above in replication of Table 5)


%% Table A10 (covered above in replication of Figure 9)


%% Table A11 (Panel results clustering standard errors by applicant)

% Year Panel predicting approval (using EG_Replication_PanelYear.dta)

eststo clear
global base "xx_appduration xx_appyear xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal"
global main ""
global cond1 ""
global cond2 ""
global se "r cluster(xx_id)"
global opp "xx_opposition_interp"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
global opp "xx_opposition_interp xx_appyear1985_oppinterp"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
global opp "xx_opposition_interp xx_appyear1985_oppinterp xx_appduration_oppinterp"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp $cond1 $cond2, $se
esttab, pr2 b(3)

% Application Panel predicting approval (using EG_Replication_PanelApp.dta)

eststo clear
global base "xx_appnumber xx_estyear xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal"
global main ""
global cond1 ""
global cond2 ""
global se "r cluster(xx_id)"
global opp "xx_opposition_interp"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global cond1 "if xx_appnumber > 1"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
global cond1 "if xx_appnumber > 2"
eststo: quietly logit xx_decisioncens_dum $base $main $opp $cond1 $cond2, $se
esttab, pr2 b(3)


%% Table A12 (Panel results with equal weight across applicants)

% Year Panel predicting approval (using EG_Replication_PanelYear.dta)

eststo clear
global base "xx_appduration xx_appyear xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal"
global main ""
global cond1 ""
global cond2 ""
global se "r"
global opp "xx_opposition_interp"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp [iweight=1/xx_idcount] $cond1 $cond2, $se
global opp "xx_opposition_interp xx_appyear1985_oppinterp"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp [iweight=1/xx_idcount] $cond1 $cond2, $se
global opp "xx_opposition_interp xx_appyear1985_oppinterp xx_appduration_oppinterp"
eststo: quietly logit xx_decisioncens_dum_interp $base $main $opp [iweight=1/xx_idcount] $cond1 $cond2, $se
esttab, pr2 b(3)

% Application Panel predicting approval (using EG_Replication_PanelApp.dta)

eststo clear
global base "xx_appnumber xx_estyear xx_gender xx_ageest xx_elderly xx_work_collapsed xx_pagetotal"
global main ""
global cond1 ""
global cond2 ""
global se "r"
global opp "xx_opposition_interp"
eststo: quietly logit xx_decisioncens_dum $base $main $opp [iweight=1/xx_idcount] $cond1 $cond2, $se
global cond1 "if xx_appnumber > 1"
eststo: quietly logit xx_decisioncens_dum $base $main $opp [iweight=1/xx_idcount] $cond1 $cond2, $se
global cond1 "if xx_appnumber > 2"
eststo: quietly logit xx_decisioncens_dum $base $main $opp [iweight=1/xx_idcount] $cond1 $cond2, $se
esttab, pr2 b(3)




